﻿using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System;

using System.Data.SqlClient;
using System.Web.Services;

using System.Data;
using System.Configuration;
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Data.SqlClient;
using System.Drawing;
using System.Net.Mail;

using System.Web.Services;

using System.IO.MemoryMappedFiles;

public partial class admin_print : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string ss;
        if (Session["email"] == null)
        {
            Response.Redirect("sessiont.aspx");
        }
        ss = Session["p_id"].ToString();
       
        if (Page.IsPostBack)
        {
        }
        else
        {
            string str = Session["p_id"].ToString();
            Image1.ImageUrl = "property.ashx?p_id=" + str.ToString();
            SqlConnection conn = null;
            conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);


            conn.Open();
            SqlCommand scmd = new SqlCommand("SELECT * FROM properties_rent where p_id='" + Session["p_id"] + "'", conn);

            SqlDataReader dr = scmd.ExecuteReader();
            if (dr.Read())
            {

                txtfname1.Text = dr[4].ToString();
                lblstreet.Text = dr[11].ToString();
                lblprice.Text = dr[55].ToString();
                lblproptype.Text = dr[15].ToString();
                lblcond.Text = dr[17].ToString();
                lblelevatr.Text = dr[26].ToString();
                lblparking.Text = dr[31].ToString();
                lbshower.Text = dr[37].ToString();
                lbltoilet.Text = dr[35].ToString();
                lblac.Text = dr[67].ToString();
                Lblpermises.Text = dr[59].ToString();
                lblssn.Text = dr[12].ToString();
                lblcity.Text = dr[10].ToString();
                Lblda.Text = dr[119].ToString();
                lbltype.Text = "To Rent";
            }


            dr.Close();
        }
    }

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        Response.Redirect("../admin.aspx");
    }
}